package com.hmy.finance.dal.po.receipt;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hmy.finance.api.common.enums.receipt.OffsetStatusEnum;
import com.hmy.finance.dal.po.receipt.handler.OffsetBillDetailInfoHandler;
import com.hmy.finance.dal.po.receipt.json.OffsetBillDetailInfo;
import lombok.Data;
import org.apache.ibatis.type.EnumTypeHandler;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 合同费用核销记录
 *
 * @TableName contract_offset_record
 */
@TableName(value = "contract_offset_record", autoResultMap = true)
@Data
public class ContractOffsetRecordPo implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = -7692050413073969649L;
    /**
     * 主键ID
     */
    @TableId(value = "id")
    private Long id;
    /**
     * 联系人ID
     */
    @TableField(value = "contactor_id")
    private Long contactorId;
    /**
     * 关联销售合同ID
     */
    @TableField(value = "contract_id")
    private Long contractId;

    /**
     * 关联的收款核销申请单据ID
     */
    @TableField(value = "receipt_offset_bill_id")
    private Long receiptOffsetBillId;

    /**
     * 关联联系人账户流水ID
     */
    @TableField(value = "contactor_trade_id")
    private Long contactorTradeId;
    /**
     * 核销总额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * Actual Offset Amount
     */
    @TableField(value = "actual_offset_amount")
    private BigDecimal actualOffsetAmount;
    /**
     * Offset Status
     */
    @TableField(value = "offset_status", typeHandler = EnumTypeHandler.class)
    private OffsetStatusEnum offsetStatus;
    /**
     * Offset Bill Detail Info List
     */
    @TableField(value = "offset_bill_detail_infos", typeHandler = OffsetBillDetailInfoHandler.class)
    private List<OffsetBillDetailInfo> offsetBillDetailInfos;

    /**
     * 费用发生日期
     */
    @TableField(value = "fee_incurred_time")
    private LocalDateTime feeIncurredTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 创建人ID
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 更新人ID
     */
    @TableField(value = "updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField(value = "updater_name")
    private String updaterName;

    /**
     * 是否删除，0-否；1-是
     */
    @TableField(value = "is_deleted")
    @TableLogic
    private Integer isDeleted;

}